package com.test.SocketDemo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

/**
 * ${DESCRIPTION}
 *
 * @author muxiaoyu
 * @create 2017/06/07 15:55
 **/
public class SocketClient2 {
    public static void main(String[] args) throws IOException {
        Socket chatSocket = new Socket("127.0.0.1", 4242);
        InputStreamReader inputStreamReader = new InputStreamReader(chatSocket.getInputStream());
        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        String msg = bufferedReader.readLine();
        System.out.println(msg);

    }
}
